<template>
	<view>
		<view style="background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/e63bcf73858e37c567847ca55821ddfa.png) no-repeat;background-size: 100%;width: 100%;height: 414rpx;">

		</view>
		<view style="width: 92%;position: absolute;top:10rpx;left: 4%;padding-bottom: 30rpx;">
			<view v-if="list3.length>0" style="margin-bottom: 30rpx;">
				<u-swiper
				            :list="list3"
							height="160"
							radius="10"
				            indicator
				            indicatorMode="line"
				            circular
				    ></u-swiper>
			</view>
			<view v-if="false" style="width: 690rpx;background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220329/%E5%9B%BE%E5%B1%82%20567%402x.png) no-repeat;background-size: 100% 100%;margin-bottom: 26rpx;box-sizing: border-box;padding: 24rpx 30rpx 36rpx;position: relative;">
				<view style="overflow: hidden;" class="flex justify-between" v-if="false">
					<view class="flex items-center">
						<view style="width: 80rpx;">
							<image :src="xq.logo_image" style="width: 80rpx;height: 80rpx;display: block;" mode=""></image>
						</view>
						<view class="flex items-center pl30 data_item">
							<view class="w-120 tac">
								<view class="text_num flex items-center justify-center"><text class="fs32">{{xq.views_num || 0}}</text> <text class="text_unit fs24">人</text></view>
								<text class="text_title fs24">浏览量1</text>
							</view>
							<view class="w-120 tac">
								<view class="text_num fs32"><text class="fs32">{{xq.attention_num || 0}}</text></view>
								<text class="text_title fs24">关注数</text>
							</view>
							<view class="w-120 tac">
								<view class="text_num fs32 flex items-center justify-center"><text class="fs32">{{xq.attention_num || 0}}</text> <text class="text_unit fs24">次</text></view>
								<text class="text_title fs24">联系次数</text>
							</view>
						</view>
					</view>
					<view>
						<image src="@/static/index/icon_share.png" style="width: 48rpx;height: 48rpx;display: block;" mode=""></image>
					</view>
				</view>
				<view class="mt20">
					<view>
						<view style="line-height: 40rpx;color: #000000;font-size: 36rpx;font-weight: 600;" class="yihang">
							{{xq.name || ''}}
						</view>
						<view style="color: #999999;font-size: 22rpx;margin-top: 16rpx;line-height: 30rpx;" class="sanhang">
							<view class="flex justify-between">
								<text v-if="xq.special_manage!=3">主营1：</text>
								<text v-if="xq.special_manage==3">生产线：</text>
								<view class=""  @click="openReport" style="color: #999;font-size: 22rpx;line-height: 60rpx;text-align: right;">
									举报
								</view>
							</view>
							<text v-if="xq.special_manage!=3">{{xq.manage || '暂无主营'}}</text>
							<text v-if="xq.special_manage==3">{{xq.process_text || '暂无生产线'}}</text>
						</view>
					</view>
					<!-- <view style="width: 15%;float: left;text-align: right;padding-top: 10rpx;">
						<text style="background: linear-gradient(0deg, #C18C26 0%, #E1AC4E 100%);color: #FFFFFF;font-size: 22rpx;padding: 2rpx 10rpx;">
							认证
						</text>
					</view> -->
				</view>
				<view style="line-height: 40rpx;color: #999999;font-size: 24rpx;margin-top: 20rpx;width: 85%;">
					<text class="iconfont icon-dizhi1" style="color: #999999;font-size: 26rpx;"></text>
					{{xq.address || ''}}
				</view>
				 <!-- #ifdef MP-WEIXIN -->
				<text class="iconfont icon-zhuanfa" style="position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);font-size: 40rpx;"></text>
				<button open-type="share" style="position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);opacity: 0;width: 20rpx;height: 20rpx;" type="default"></button>
				<!-- #endif -->

				<view style="width: 100%;">

					<!-- <view style="display: flex;line-height: 80rpx;font-size: 24rpx;">
						<view style="flex: 1;color: #999999;">
							管理员：{{xq.admin_user.name}}
						</view>
						<view @click="phone" style="flex: 2;color: #999999;text-align: right;">
							电话：{{xq.admin_user.mobile}}
						</view>
					</view> -->
					<view style="margin:30rpx 0 0;overflow: hidden;">
						<image v-for="(item,index) in xq.views_user" :key='index' :src="item" class="tou" mode=""></image>
						<text style="color: #666666;font-size: 24rpx;line-height: 54rpx;float: right;">{{xq.views_num || 0}}人看过</text>
					</view>
				</view>
			</view>
			<companyDetail :item="xq" @openReport="openReport"></companyDetail>

			<view style="display: flex;line-height: 80rpx;text-align: center;margin: 20rpx auto;">
				<view class="tal" style="position: relative;" @click="qi_huo(1)" :class="qh_type==1?'qiactive_type':'qi_type'">
					最新动态
				</view>
				<!-- <view style="flex: 1;position: relative;" @click="qi_huo(0)" :class="qh_type==0?'qiactive_type':'qi_type'">
					商品橱窗
				</view> -->

				<view style="flex: 1;position: relative;" @click="qi_huo(2)" :class="qh_type==2?'qiactive_type':'qi_type'">
					企业介绍
				</view>
				<view style="position: relative;" @click="qi_huo(3)" :class="qh_type==3?'qiactive_type':'qi_type'">
					留言互动
				</view>
			</view>
			<view v-if="qh_type==0" style="padding-bottom: 150rpx;">
				<view style="width: 100%;margin: 20rpx auto;overflow: hidden;box-sizing: border-box;padding: 0 10rpx;" class="box">
					<view @click="tuijian(item.id)" style="width: 310rpx;float: left;" v-for="(item,index) in list" :key='index'>
						<image src="../../../static/logo.png" style="width: 310rpx;height: 310rpx;border-radius: 12rpx;" mode=""></image>
						<view style="width: 100%;">
							<view style="line-height: 40rpx;font-size: 28rpx;color: #333333;" class="yihang">{{item.name}}</view>
							<!-- <view style="line-height: 30rpx;font-size: 22rpx;color: #006EBC;margin: 4rpx 0;" class="yihang">适合渠道：{{item.channel}}</view> -->
							<view style="width: 100%;line-height: 40rpx;color: #333333;font-size: 28rpx;">
								<text style="color: #000000;font-size: 24rpx;font-weight: 600;">￥{{item.cost}}</text>
								<text v-if="item.unit" style="color: #666666;font-size: 22rpx;">/{{item.unit}}</text>
							</view>
						</view>
					</view>
				</view>

				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
						v-if="list.length==0"></u-divider>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
						v-if="list.length>0 && enmpy"></u-divider>
				</view>
			</view>
			<view v-if="qh_type==1" style="padding-bottom: 150rpx;">
				<view v-for="(item,index) in list" :key='index' style="width: 100%;margin: 20rpx auto;padding: 30rpx;box-sizing: border-box;border-radius:16rpx;background-color: #FFFFFF;">
					<view style="overflow: hidden;">
						<view style="width: 80rpx;height: 80rpx;float: left;margin-right: 30rpx;position: relative;">
							<image :src="item.user.avatar" style="width: 80rpx;height: 80rpx;display: block;border-radius: 12upx;overflow: hidden;"
								mode=""></image>
							<image v-if="item.user.is_vip==1 && item.type==2"
								src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/ren.png" style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 4;"
								mode=""></image>
							<image v-if="item.user.is_vip==2 && item.type==2"
								src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220616/ce4d9a4e5c9d814d939dc3324abc44d6.png" style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 4;"
								mode=""></image>
							<image v-if="item.type==1"
								src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220616/daf7dad493b169a57961fac90302d9be.png" style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 4;"
								mode=""></image>
						</view>
						<view style="width: 82%;float: left;">
							<view style="line-height: 50rpx;margin-bottom: 10rpx;overflow: hidden;margin-bottom: 10rpx;">
								<text v-if="item.user.is_vip==2" style="color: #2B85E4;font-size: 30rpx;display: block;max-width: 300rpx;float: left;"
									class="yihang">{{item.user.nickname}}</text>
								<text v-if="item.user.is_vip==1" style="color: #F29100;font-size: 30rpx;display: block;max-width: 300rpx;float: left;font-weight: 600;"
									class="yihang">{{item.user.nickname}}</text>
								<!-- <image @click="yonghu_xx(item.user_id)"
									src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/shenfen.png" style="width: 28rpx;height: 22rpx;float: left;margin-top: 14rpx;margin-left: 20rpx;"
									mode=""></image> -->
							</view>
							<view style="overflow: hidden;">
								<text class="xiao" style="color: red;" v-if="item.is_top==1">置顶</text>
								<text v-if="item.category" class="xiao">{{item.category.name}}</text>
							</view>
							<!-- <view style="height: 30rpx;line-height: 30rpx;color: #999999;font-size: 24rpx;"
								class="yihang">
								{{item.user.company || ''}}
							</view> -->
						</view>
					</view>
					<view @click="tzxq(item.id)" style="color: #000000;font-size: 28rpx;line-height: 40rpx;margin: 20rpx 0;">
						<view>{{item.main_content}}</view>
					</view>
					<view @click="tzxq(item.id)"  style="overflow: hidden;" class="tu">
						<view v-for="(a,b) in item.main_images" :key='index' style="width: 190rpx;height: 190rpx;float: left;border-radius: 16rpx;overflow: hidden;">
							<image :src="a" style="width: 100%;height: 100%;left: 0;" mode="aspectFill"></image>
						</view>

					</view>
					<view @click="tzxq(item.id)" style="overflow: hidden;margin: 20rpx 0 0;">
						<text
							style="color: #999999;font-size: 26rpx;float: left;display: block;width: 280rpx;line-height: 60rpx;">{{item.create_time}}</text>
						<view style="float: right;line-height: 60rpx;">
							<image
								src="@/static/index/icon_collect.png"
								style="width: 36rpx;height: 36rpx;float: left;margin-top: 12rpx;margin-right: 6rpx;" mode=""></image>
							<text style="color: #000000;font-size: 24rpx;float: left;margin-right: 14rpx;">
								{{item.collect_num>10000?( (item.collect_num/10000).toFixed(1)+'万' ):item.collect_num || 0}}
							</text>
						</view>
						<view style="float: right;line-height: 60rpx;margin-right: 10rpx;">
							<image
								src="@/static/index/icon_comment.png"
								style="width: 36rpx;height: 36rpx;float: left;margin-top: 12rpx;margin-right: 6rpx;" mode=""></image>
							<text style="color: #000000;font-size: 24rpx;float: left;margin-right: 14rpx;">
								{{item.comment_num>10000?( (item.comment_num/10000).toFixed(1)+'万' ):item.comment_num || 0}}
							</text>
						</view>
						<view style="float: right;line-height: 60rpx;margin-right: 10rpx;">
							<image
								src="@/static/index/icon_like.png"
								style="width: 36rpx;height: 36rpx;float: left;margin-top: 12rpx;margin-right: 6rpx;" mode=""></image>
							<text style="color: #000000;font-size: 24rpx;float: left;margin-right: 14rpx;">
								{{item.like_num>10000?( (item.like_num/10000).toFixed(1)+'万' ):item.like_num || 0}}
							</text>
						</view>

					</view>

				</view>
				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
						v-if="list.length==0"></u-divider>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
						v-if="list.length>0 && enmpy"></u-divider>
				</view>
			</view>
			<view v-if="qh_type==2" style="padding-bottom: 150rpx;">
				<view v-if="xq.main_content" style="width: 100%;box-sizing: border-box;padding: 30rpx 20rpx;border-radius: 16rpx;background-color: #FFFFFF;margin-top: 30rpx;">
					<view v-html="xq.main_content" style="color: #010101;font-size: 24rpx;line-height: 50rpx;">

					</view>
				</view>
				<view v-if="xq.main_content==''" style="text-align: center;">
					<image :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<view style="text-align: center;color: #999999;font-size: 30rpx;line-height: 60rpx;">
						暂无企业介绍
					</view>
				</view>
			</view>
			<view v-if="qh_type==3" style="padding-bottom: 150rpx;">
				<view v-if="list.length>0" style="width: 100%;margin-top: 30rpx;background-color: #FFFFFF;box-sizing: border-box;padding: 30rpx;border-radius: 16rpx;">
					<view  v-for="(item,index) in list" :key='index' style="padding-bottom: 20rpx;border-bottom: 1px solid #eeeeee;">
						<view style="width: 92%;overflow: hidden;margin: 20rpx auto;">
							<image :src="item.client.avatar" style="width: 64rpx;height: 64rpx;display: block;float: left;border-radius: 50%;margin-top: 8rpx;" mode=""></image>
							<view style="margin-left: 20rpx;float: left;">
								<view style="line-height: 40rpx;color: #191919;font-size: 26rpx;">
									{{item.client.nickname}}
								</view>
								<view style="line-height: 40rpx;color: #999999;font-size: 24rpx;">
									{{item.create_time}}
								</view>
							</view>
						</view>
						<view style="width: 92%;margin: 0 auto;color: #191919;font-size: 24rpx;line-height: 50rpx;">
							{{item.comment || ''}}
						</view>
						<!-- <view style="width: 92%;margin: 0 auto;color: #999999;font-size: 24rpx;line-height: 40rpx;">
							浏览{{item.pv}}次
						</view> -->
						<view v-if='item.reply' style="width: 92%;margin: 10rpx auto 30rpx;box-sizing: border-box;padding: 30rpx;border-radius: 10rpx;background-color:#F7F7F7 ;font-size: 26rpx;line-height: 50rpx;word-break:break-all;word-wrap:break-word;">
							<text style="color: #336699;">{{item.firm.name}}：</text>
							<text style="color: #333333;">{{item.reply}}</text>
						</view>
					</view>
				</view>
				<view style="text-align: center;">
					<image v-if="kk" :src="require('@/static/my/no-data.png')" style="width: 334rpx;"  mode="widthFix"></image>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
						v-if="list.length==0"></u-divider>
					<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
						v-if="list.length>0 && enmpy"></u-divider>
				</view>
			</view>
			<view style="position: fixed;left: 0;bottom: 0;width: 100%;background-color: #FFFFFF;z-index: 100;">
				<view style="width: 100%;box-sizing: border-box;padding: 30rpx 30rpx 50rpx;display: flex;">
					<view @click="lianxi" style="flex: 2;">
						<view style="width:100%;height: 60rpx;line-height: 60rpx;border-radius: 30rpx;text-align: center;background-color: #1fb0ac;color: #FFFFFF;font-size: 24rpx;text-align: center;">
							企业通讯录
						</view>
					</view>
					<!-- <view @click="lahei" style="flex: 2;color: #000000;font-size: 26rpx;line-height: 60rpx;font-weight: 600;margin-left: 20rpx;">
						<text>拉黑该企业</text>
					</view> -->
					<view @click="gz_cj" style="flex: 1;color: #242935;font-size: 24rpx;line-height: 60rpx;">
						<image v-if="xq.is_attention==2" src="@/static/index/icon_collect.png" style="width: 40rpx;height: 40rpx;float: left;margin: 10rpx 10rpx 10rpx 30rpx;" mode=""></image>
						<image v-if="xq.is_attention==1" src="@/static/index/icon_collect1.png" style="width: 40rpx;height: 40rpx;float: left;margin: 10rpx 20rpx;" mode=""></image>
						<text v-if="xq.is_attention==1" style="color: #F0AD4E;">已关注企业</text>
						<text v-if="xq.is_attention==2">关注该企业</text>
					</view>
				</view>
			</view>
		</view>
		<image v-if="qh_type==3" @click="liu" src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/liu.png" style="width: 80rpx;height: 80rpx;position: fixed;right: 0;bottom: 400rpx;" mode=""></image>
		<uni-popup id="popup" ref="popup5" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 600rpx;">
				<textarea   v-model="nei" placeholder="请输入您的留言" style="padding:20rpx;font-size: 24rpx;line-height: 40rpx;height: 200rpx;" />
				<view class="footer">
					<button @click="quxiao5" style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
					 type="default">取消</button>
					<button @click="huifu" lang="zh_CN" style="flex: 1;background-color: #1fb0ac;color: #FFFFFF;" open-type="getUserInfo">留言</button>
					<!-- <button @click="submitLink" type="default" class="submit">确认提交</button> -->
				</view>
			</view>
		</uni-popup>

		<uni-popup id="popup" ref="popup2" :type="type_status" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的手机号</view>
				<view class="footer">
					<button @click="quxiao2"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @getphonenumber="login2" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getPhoneNumber">确定</button>

				</view>
			</view>
		</uni-popup>
		<uni-popup id="popup" ref="popup" :type="type_status" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的用户信息</view>
				<view class="footer">
					<button @click="quxiao"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @click="login" lang="zh_CN" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getUserInfo">确定</button>

				</view>
			</view>
		</uni-popup>
		<uni-popup
      class="login-popup"
      mode="center"
      id="popupReport"
      mask-background-color="rgba(0,0,0,0.9)"
      ref="popupReport"
      :type="type_status"
      :animation="true"
    >
      <view class="login_container relative" style="background-color: #FFFFFF;padding:50rpx 44rpx 30rpx;border-radius: 20rpx;">
        <view
          class=""
          style="background-color: #FFFFFF;border-radius: 20rpx;">
          <view style="line-height: 80upx;color: #333333;font-size: 30upx;height: 80rpx;">
            内容描述
          </view>
          <view class="textarea_item">
            <textarea  maxlength="540" placeholder="请输入内容描述(最多540字符)" v-model="reportContent"
            style="width: auto;height: 300rpx;line-height: 40rpx;font-size: 26rpx;" />
          </view>
          <view class="upload">
            <view class="uploadimgcont">
              <view class="uploadimga" v-for="(item,index) in addImgArray_arr" :key="index">
                <view class="delete" @click="imgdelete(index)">
                  <view class="deleteline">
                  </view>
                </view>
                <image @click="fangda(index)" :src="item" mode="aspectFill"></image>
              </view>
              <view  v-if="!addImgArray_arr || addImgArray_arr.length<9" class="uploadimg" @click="chooseImage">
                <image
                  src="@/static/msg/add-photo.png"
                  style="border-radius: 12rpx;" mode=""></image>
              </view>
            </view>
          </view>
        </view>
        <view class="footer1 flex" style="display: flex;align-items: center;justify-content: center;margin-top: 60rpx;">
          <u-button
            style="width: 240rpx;height: 80rpx;
                line-height: 80rpx;
                color: #666;
                border-radius: 80rpx;
                border: 1px solid #d9d9d9;
                background-color: #d9d9d9;
                margin-right: 30rpx;"
            text="取消"
            @click="cancelPopupReport"
            shape="circle"
          ></u-button>
          <u-button
            @click="submitReport"
            style="width: 240rpx;
              height: 80rpx;
              line-height: 80rpx;"
            text="确定"
            shape="circle"
            color="linear-gradient(to right, #1CD19F, #1FB0AC)"
          ></u-button>
        </view>
      </view>
    </uni-popup>
    <uploadImg :singleNum="false" ref="uploadImg" v-model="addImgArray_arr" permissionCameraContent="获取拍照权限是为了能够上传图片" permissionAlbumContent="获取相册权限，是为了能够上传图片" />
    <noLoginToast ref="noLoginToast" />
		<callPhone ref="callPhone"/>
	</view>
</template>

<script>
	import {
		validateNull
	} from '@/common'
	export default{
		data(){
			return{
				type_status: 'top',
				isChecked: false,
				isLogin: 'login',
				reportId: '',
				reportContent: '',
				addImgArray_arr: [],
				reportParams: {},
				list3: [],
				qh_type:1,
				id:'',
				xq:{},
				page:1,
				list:[],
				kk:false,
				enmpy:false,
				type:'center',
				nei:'',
				name:'',
				degree:'',
				content:''
			}
		},
		onReachBottom: function() {
			if(this.qh_type==1){
				if (this.enmpy) {
					return
				} else {
					this.gengxin()
				}
			}else if(this.qh_type==3){
				if (this.enmpy) {
					return
				} else {
					this.liuyan()
				}
			}else if(this.qh_type==0){
				if (this.enmpy) {
					return
				} else {
					this.shop()
				}
			}

		},
		onLoad(option) {
			this.id=option.id
			this.name=option.name
			uni.setNavigationBarTitle({
				title:this.name
			})
			this.gengxin()
			this.qyxq()
		},
		onShow() {
			this.user_infoxx()
		},
		onShareAppMessage: function(e) {
						// let title = '恭喜dog.东西获得成功'
						let that=this
						return {
							title: this.xq.shop_name,
							path:'/fenbao/pages/wenzhang/qyxq?id='+this.id+'&name='+this.name,

						}
					},
		onShareTimeline: function(e) {
			let that=this
			return {
				title: this.xq.shop_name,
				path:'/fenbao/pages/wenzhang/qyxq?id='+this.id+'&name='+this.name,

			}
		},
		methods:{
			async openReport() {
				let isLogin = await this.$refs.noLoginToast.open()
				if (!isLogin) {
					return
				}
				this.$refs.popupReport.open()
			},
			submitReport() {
				if (validateNull(this.reportContent)) {
					return uni.showToast({
						title: '内容不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				if (validateNull(this.addImgArray_arr)) {
					return uni.showToast({
						title: '图片不能为空',
						icon: 'none',
						duration: 1000
					})
				}
				// /api/client/complaint     POST
				// uid=投诉对象id，必传
				// msg=消息，必传
				// img=图片，非必传
				let params = {
					msg: this.reportContent,
					img: this.addImgArray_arr.join(','),
					uid: this.xq.client_id
				}
				console.log('%c [ params ]-144', 'font-size:13px; background:pink; color:#bf2c9f;', params)
				// return
				this.post('api/client/complaint',params,true).then(res=>{
					if(res.code==1){
						uni.showToast({
							title: '举报成功',
							icon: "none",
							duration: 1000
						})
						this.closePopupReport()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			cancelPopupReport() {
				this.closePopupReport()
			},
			closePopupReport() {
				this.$refs.popupReport.close()
			},
			// 上传图片
			async chooseImage() {
				// let isLogin = await this.$refs.noLoginToast.open()
				// if (!isLogin) {
				// 	return
				// }
				// let stutas = await requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE')
				// openAppSettingPermissions()
				// console.log('%c [ stutas ]-862', 'font-size:13px; background:pink; color:#bf2c9f;', stutas)
				let that = this
				if (that.addImgArray_arr.length >= 9) {
					uni.showToast({
						icon: 'none',
						title: '最多上传9张图片'
					})
					return
				}
				try {
					this.$refs.uploadImg.open()
				} catch (error) {
					uni.hideLoading()
				}
			},
			// 删除图片
			imgdelete(index) {
				// this.addimgArray.splice(index, 1)
				this.addImgArray_arr.splice(index, 1)
				// this.addimgArray.splice(index, 1)
			},
			user_infoxx: function() {
				this.post('api/client/info', '', true).then(res => {
					console.log(res)
					if (res.code == 1) {

						this.degree=res.data.degree
					}
				})
			},
			quxiao2: function() {
				this.$refs.popup2.close()
			},
			login2: function(e) {
				console.log(e)
				let that = this
				this.$refs.popup2.close()
				uni.login({
					provider: 'weixin',
					success: (code) => {
						console.log(code)
						this.post('api/wechat/phone', {
							code: code.code,
							iv: e.detail.iv,
							encryptedData: e.detail.encryptedData
						}, true).then(res => {
							console.log(res, '123455')
							if (res.code == 1) {
								uni.setStorageSync('mobile', res.data.phoneNumber)
								uni.setStorageSync('mobile2',res.data.mobile2)
							}

						})

					}
				})
			},
			// 打电话
			async phone(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.$refs.callPhone.open(this.xq.admin_user.mobile)
				// uni.makePhoneCall({
				// 	phoneNumber: this.xq.admin_user.mobile //仅为示例
				// });
			},
			// 商品详情
			tuijian(id){
				uni.navigateTo({
					url:'../../../subpages/pages/yx_xq?id='+id
				})
			},
			// 用户信息
			yonghu_xx(id){
				uni.navigateTo({
					url:'../wenzhang/yhxx?id='+id
				})
			},
			// 帖子详情
			tzxq(id){
				uni.navigateTo({
					url:'wzxq?id='+id
				})
			},
			qi_huo(index){
				this.qh_type=index
				if(index==1){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.gengxin()
				}else if(index==3){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.liuyan()
				}else if(index==0){
					this.kk=false
					this.list=[]
					this.enmpy=false
					this.page=1
					this.shop()
				}
			},
			// 商品橱窗
			shop(){
				let data={
					firm_id:this.id,
					page:this.page,
					limit:10
				}
				this.post('api/firm_data/goods',data,true).then(res=>{
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 最新动态
			gengxin(){
				this.post('api/firm_data/voice',{firm_id:this.id,page:this.page,limit:10},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 留言互动
			async liuyan(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.post('api/firm_data/message_list',{firm_id:this.id,page:this.page,limit:10},true).then(res=>{
					console.log(res)
					if(res.code==1){
						if(this.page==1){
							if (res.data.data== null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}else{
							if (res.data.data== null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
					}else{
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			async liu(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				if(this.degree<100){
      		this.$refs.model.open()
				}
				else {
					this.$refs.popup5.open()
				}
			},
			quxiao5(){
				this.$refs.popup5.close()
			},
			async huifu(){
				let isLogin = await this.$refs.noLoginToast.open()
     		if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.post('api/firm_data/message',{firm_id:this.id,comment:this.nei},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						this.$refs.popup5.close()
						this.nei=''
						this.page= 1
						this.kk=false
						this.enmpy= false
						this.list=[]
						this.liuyan()
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			// 联系企业
			async lianxi(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				uni.navigateTo({
					url:'lxqy?id='+this.id
				})
			},

			// 企业详情
			qyxq(){
				this.post('api/firm_data/info',{id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.xq=res.data
						// this.content=res.data.main_content.replace(/<img/gi,   '<img class="rich-img" ')
						this.list3=res.data.main_images
					}
				})
			},
			// 关注企业
			async gz_cj(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				this.post('api/firm_data/attention',{firm_id:this.id},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						if(res.data){
							this.xq.is_attention=1
						}else{
							this.xq.is_attention=2
						}
					}
				})
			},
			// 拉黑企业
			async lahei(){
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
					this.post('api/client/black_firm',{firm_id:this.id},true).then(res=>{
						console.log(res)
						if(res.code==1){
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
							setTimeout(function(){
								uni.switchTab({
									url:'/pages/index/index'
								})
							},1500)
						}else{
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
						}
					})

			},
		}
	}
</script>

<style lang="scss">
	.rich-img {
		max-width: 100% !important;
		height: auto!important;
		display: block;
		// background-color: #FFFFFF;
	}
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
	.box>view:nth-child(2n+1){
		margin-right: 50rpx;
	}
	.box>view{
		margin-bottom: 30rpx;
	}
	.xiao {
		color: #19BE6B;
		font-size: 20rpx;
		padding: 0rpx 10rpx;
		background: #f3f3f3;
		border-radius: 14rpx;
		display: inline-block;
		height: 30rpx;
		line-height: 30rpx;
		margin-right: 10rpx;
		margin-bottom: 10rpx;
		float: left;
	}
	page{
		background-color: #F8F8F8!important;
		padding-bottom: 150rpx;
		font-family: Demibold;
	}
	.tu>view {
		margin: 10rpx 0;
	}

	.tu>view:nth-child(3n+2) {
		margin: 10rpx 30rpx;
	}
	.fenlei{
		width: 100%;
		margin-top: 26rpx;
		height: 350rpx;
		background: url(https://dyeego.oss-cn-beijing.aliyuncs.com/uploads/20220325/dbfaf5dddb188c6274941398431f8080.png) no-repeat;
		background-size: 100%;
		box-sizing: border-box;
		padding: 50rpx 0;
	}
	.tui_mei{
		color: #666666;
		font-size: 28rpx;
		font-weight: 500;
	}
	.tui_active{
		color: #000000;
		font-size: 28rpx;
		font-weight: 600;
	}
	.tou{
		width: 54rpx;
		height: 54rpx;
		float: left;
		border-radius: 50%;
		margin-left: -20rpx;
	}
	.tou:first-child{
		margin-left: 0;
	}

	.qi_type{
		color: #999999;
		font-size: 30rpx;
		font-weight: 500;
	}
	.qiactive_type{
		color: #000000;
		font-size: 30rpx;
		font-weight: 600;
	}
	.qiactive_type::after {
	     content: ''; // 必须
	     position: absolute;
	     left: 50%;
	     bottom: 0rpx;
		 transform: translateX(-50%);
	     width: 60rpx;
	     height: 6rpx;
	     background-color: #0078FF;
	}
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
	.data_item {
		.text_num {
			line-height: 48rpx;
			color: #262D2C;
		}
		.text_title {
			line-height: 36rpx;
			color: #ABAFB3;
		}
		.text_unit {
			color: #ABAFB3;
		}
	}
	// 上传图片
.upload {
		// background: #FFFFFF;
		// padding: 0 40rpx;
		// height: 100vh;
		// height: 700upx;

		.title {
			font-size: 30rpx;
			font-weight: bold;
			color: #343434;
			padding-top: 15rpx;
		}

		.uploadimgcont {
			display: flex;
			// justify-content: space-between;
			flex-wrap: wrap;
			// margin-top: 50rpx;
			// margin:30upx 0 136upx;

			.uploadimga {
				width: 186rpx;
				height: 186rpx;
				margin-right: 24upx;
				margin-bottom: 40upx;
				position: relative;

				.delete {
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					background: #5093ff;
					display: flex;
					align-items: center;
					justify-content: space-around;
					position: absolute;
					top: -10upx;
					left: -10upx;
					z-index: 4;

					.deleteline {
						background: #FFFFFF;
						height: 5rpx;
						width: 50%;
					}
				}

				image {
					width: 100%;
					height: 100%;
				}
			}

			.uploadimg {
				width: 120rpx;
				height: 120rpx;
				background: #F9F9F9;
				border-radius: 120rpx;
				// overflow: hidden;
				position: relative;

				image {
					width: 100%;
					height: 100%;
				}

				view {
					position: absolute;
					bottom: 10rpx;
					left: 50%;
					width: 100%;
					text-align: center;
					transform: translateX(-50%);
					font-size: 28rpx;
					color: #404040;
				}
			}
		}

}
.textarea_item {
  padding: 20rpx;
  border: 1rpx solid #ddd;
  margin-bottom: 20rpx;
}
</style>
